/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.acmwustl.bubble.windowutils;

import java.awt.Component;
import java.awt.Toolkit;

/**
 *
 * @author officer
 */
public class WindowUtils {

    public static void centerWindow(Component f) {
        int width = f.getWidth();
        int height = f.getHeight();
        int screenW = (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth();
        int screenH = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight();

        int locX = (screenW / 2) - (width / 2);
        int locY = (screenH / 2) - (height / 2);

        f.setLocation(locX, locY);
    }

}
